package com.bw.main

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.bw.home.view.HomeFragment
import com.bw.message.MessageFragment
import com.bw.mine.MineFragment
import com.bw.notice.NoticeFragment
import com.bw.server.ServiceFragment

class MainPageAdapter(fragmentActivity: FragmentActivity):FragmentStateAdapter(fragmentActivity) {

    private val fragmentList = listOf(
        HomeFragment(),
        ServiceFragment(),
        MessageFragment(),
        NoticeFragment(),
        MineFragment()
    )
    override fun getItemCount(): Int = fragmentList.size

    override fun createFragment(position: Int): Fragment = fragmentList[position]

}